package com.toocms.jinjuhang.ui.enterprise_windows

import com.qmuiteam.qmui.widget.webview.QMUIWebViewClient
import com.toocms.jinjuhang.BR
import com.toocms.jinjuhang.R
import com.toocms.jinjuhang.databinding.FgtEnterpriseWindowsBinding
import com.toocms.jinjuhang.ui.base.BaseFgt

class EnterpriseWindowsFgt : BaseFgt<FgtEnterpriseWindowsBinding, EnterpriseWindowsModel>() {
    override fun onFragmentCreated() {
        topBar.setTitle(R.string.str_enterprise_windows)
        binding.contentWv.apply {
            settings.apply {
                javaScriptEnabled = true
                databaseEnabled = true
                displayZoomControls = false
                setSupportZoom(false)
            }
            webViewClient = QMUIWebViewClient(true, true)
        }
    }

    override fun getLayoutResId() = R.layout.fgt_enterprise_windows

    override fun getVariableId() = BR.enterpriseWindowsModel

    override fun viewObserver() {
        viewModel.urlSingleLiveEvent.observe(this) {
            binding.contentWv.loadUrl(it)
        }
    }
}